# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kwayland
pkgver=6.2.3
pkgrel=0
pkgdesc="Qt-style Client and Server library wrapper for the Wayland libraries"
arch="all"
url="https://www.kde.org"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	qt6-qtwayland-dev
	wayland-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	plasma-wayland-protocols
	qt6-qtbase-dev
	qt6-qttools-dev
	wayland-protocols
	samurai
	"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
_repo_url="https://invent.kde.org/plasma/kwayland.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/kwayland-$pkgver.tar.xz"
options="!check" # Fails to run

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
70f70060deb3cc3ca74fc8ac86eb9569b24b35968fb20529e3c4f0e0af781b706fbb5f80d30acfe998763ef05c70eb3958e1e502e5251c5fd0bb2e85bf5a48e1  kwayland-6.2.3.tar.xz
"
